package org.fuys.etp.repo.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 弹性线程池组件
 * @TableName etp_component
 */
@TableName(value ="etp_component")
@Data
public class EtpComponent implements Serializable {
    /**
     * 组件ID 主键自增
     */
    @TableId(type = IdType.AUTO)
    private Integer componentId;

    /**
     * 组件名称
     */
    private String componentName;

    /**
     * 组件类型
     */
    private Object componentType;

    /**
     * 组件类名
     */
    private String componentBean;

    /**
     * 组件描述
     */
    private String componentDesc;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        EtpComponent other = (EtpComponent) that;
        return (this.getComponentId() == null ? other.getComponentId() == null : this.getComponentId().equals(other.getComponentId()))
            && (this.getComponentName() == null ? other.getComponentName() == null : this.getComponentName().equals(other.getComponentName()))
            && (this.getComponentType() == null ? other.getComponentType() == null : this.getComponentType().equals(other.getComponentType()))
            && (this.getComponentBean() == null ? other.getComponentBean() == null : this.getComponentBean().equals(other.getComponentBean()))
            && (this.getComponentDesc() == null ? other.getComponentDesc() == null : this.getComponentDesc().equals(other.getComponentDesc()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getComponentId() == null) ? 0 : getComponentId().hashCode());
        result = prime * result + ((getComponentName() == null) ? 0 : getComponentName().hashCode());
        result = prime * result + ((getComponentType() == null) ? 0 : getComponentType().hashCode());
        result = prime * result + ((getComponentBean() == null) ? 0 : getComponentBean().hashCode());
        result = prime * result + ((getComponentDesc() == null) ? 0 : getComponentDesc().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", componentId=").append(componentId);
        sb.append(", componentName=").append(componentName);
        sb.append(", componentType=").append(componentType);
        sb.append(", componentBean=").append(componentBean);
        sb.append(", componentDesc=").append(componentDesc);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}